3.11 \(\int \sqrt {a+b \csc ^2(c+d x)} \, dx\)

Optimal. Leaf size=81 \[ -\frac {\sqrt {a} \tan ^{-1}\left (\frac {\sqrt {a} \cot (c+d x)}{\sqrt {a+b \cot ^2(c+d x)+b}}\right )}{d}-\frac {\sqrt {b} \tanh ^{-1}\left (\frac {\sqrt {b} \cot (c+d x)}{\sqrt {a+b \cot ^2(c+d x)+b}}\right )}{d} \]

[Out]

-arctan(cot(d*x+c)*a^(1/2)/(a+b+b*cot(d*x+c)^2)^(1/2))*a^(1/2)/d-arctanh(cot(d*x+c)*b^(1/2)/(a+b+b*cot(d*x+c)^
2)^(1/2))*b^(1/2)/d

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 81, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {4128, 402, 217, 206, 377, 203} \[ -\frac {\sqrt {a} \tan ^{-1}\left (\frac {\sqrt {a} \cot (c+d x)}{\sqrt {a+b \cot ^2(c+d x)+b}}\right )}{d}-\frac {\sqrt {b} \tanh ^{-1}\left (\frac {\sqrt {b} \cot (c+d x)}{\sqrt {a+b \cot ^2(c+d x)+b}}\right )}{d} \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[a + b*Csc[c + d*x]^2],x]

[Out]

-((Sqrt[a]*ArcTan[(Sqrt[a]*Cot[c + d*x])/Sqrt[a + b + b*Cot[c + d*x]^2]])/d) - (Sqrt[b]*ArcTanh[(Sqrt[b]*Cot[c
 + d*x])/Sqrt[a + b + b*Cot[c + d*x]^2]])/d

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 217

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 377

Int[((a_) + (b_.)*(x_)^(n_))^(p_)/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Subst[Int[1/(c - (b*c - a*d)*x^n), x]
, x, x/(a + b*x^n)^(1/n)] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && EqQ[n*p + 1, 0] && IntegerQ[n]

Rule 402

Int[((a_) + (b_.)*(x_)^2)^(p_.)/((c_) + (d_.)*(x_)^2), x_Symbol] :> Dist[b/d, Int[(a + b*x^2)^(p - 1), x], x]
- Dist[(b*c - a*d)/d, Int[(a + b*x^2)^(p - 1)/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d,
0] && GtQ[p, 0] && (EqQ[p, 1/2] || EqQ[Denominator[p], 4])

Rule 4128

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist
[ff/f, Subst[Int[(a + b + b*ff^2*x^2)^p/(1 + ff^2*x^2), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p},
 x] && NeQ[a + b, 0] && NeQ[p, -1]

Rubi steps

\begin {align*} \int \sqrt {a+b \csc ^2(c+d x)} \, dx &=-\frac {\operatorname {Subst}\left (\int \frac {\sqrt {a+b+b x^2}}{1+x^2} \, dx,x,\cot (c+d x)\right )}{d}\\ &=-\frac {a \operatorname {Subst}\left (\int \frac {1}{\left (1+x^2\right ) \sqrt {a+b+b x^2}} \, dx,x,\cot (c+d x)\right )}{d}-\frac {b \operatorname {Subst}\left (\int \frac {1}{\sqrt {a+b+b x^2}} \, dx,x,\cot (c+d x)\right )}{d}\\ &=-\frac {a \operatorname {Subst}\left (\int \frac {1}{1+a x^2} \, dx,x,\frac {\cot (c+d x)}{\sqrt {a+b+b \cot ^2(c+d x)}}\right )}{d}-\frac {b \operatorname {Subst}\left (\int \frac {1}{1-b x^2} \, dx,x,\frac {\cot (c+d x)}{\sqrt {a+b+b \cot ^2(c+d x)}}\right )}{d}\\ &=-\frac {\sqrt {a} \tan ^{-1}\left (\frac {\sqrt {a} \cot (c+d x)}{\sqrt {a+b+b \cot ^2(c+d x)}}\right )}{d}-\frac {\sqrt {b} \tanh ^{-1}\left (\frac {\sqrt {b} \cot (c+d x)}{\sqrt {a+b+b \cot ^2(c+d x)}}\right )}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.23, size = 149, normalized size = 1.84 \[ \frac {\sqrt {2} \sin (c+d x) \sqrt {a+b \csc ^2(c+d x)} \left (\sqrt {a} \log \left (\sqrt {a \cos (2 (c+d x))-a-2 b}+\sqrt {2} \sqrt {a} \cos (c+d x)\right )-\sqrt {-b} \tanh ^{-1}\left (\frac {\sqrt {2} \sqrt {-b} \cos (c+d x)}{\sqrt {a \cos (2 (c+d x))-a-2 b}}\right )\right )}{d \sqrt {a \cos (2 (c+d x))-a-2 b}} \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a + b*Csc[c + d*x]^2],x]

[Out]

(Sqrt[2]*Sqrt[a + b*Csc[c + d*x]^2]*(-(Sqrt[-b]*ArcTanh[(Sqrt[2]*Sqrt[-b]*Cos[c + d*x])/Sqrt[-a - 2*b + a*Cos[
2*(c + d*x)]]]) + Sqrt[a]*Log[Sqrt[2]*Sqrt[a]*Cos[c + d*x] + Sqrt[-a - 2*b + a*Cos[2*(c + d*x)]]])*Sin[c + d*x
])/(d*Sqrt[-a - 2*b + a*Cos[2*(c + d*x)]])

________________________________________________________________________________________

fricas [B]  time = 0.67, size = 1341, normalized size = 16.56 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*csc(d*x+c)^2)^(1/2),x, algorithm="fricas")

[Out]

[1/8*(sqrt(-a)*log(128*a^4*cos(d*x + c)^8 - 256*(a^4 + a^3*b)*cos(d*x + c)^6 + 160*(a^4 + 2*a^3*b + a^2*b^2)*c
os(d*x + c)^4 + a^4 + 4*a^3*b + 6*a^2*b^2 + 4*a*b^3 + b^4 - 32*(a^4 + 3*a^3*b + 3*a^2*b^2 + a*b^3)*cos(d*x + c
)^2 - 8*(16*a^3*cos(d*x + c)^7 - 24*(a^3 + a^2*b)*cos(d*x + c)^5 + 10*(a^3 + 2*a^2*b + a*b^2)*cos(d*x + c)^3 -
 (a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cos(d*x + c))*sqrt(-a)*sqrt((a*cos(d*x + c)^2 - a - b)/(cos(d*x + c)^2 - 1))*
sin(d*x + c)) + 2*sqrt(b)*log(2*((a^2 - 6*a*b + b^2)*cos(d*x + c)^4 - 2*(a^2 - 2*a*b - 3*b^2)*cos(d*x + c)^2 +
 4*((a - b)*cos(d*x + c)^3 - (a + b)*cos(d*x + c))*sqrt(b)*sqrt((a*cos(d*x + c)^2 - a - b)/(cos(d*x + c)^2 - 1
))*sin(d*x + c) + a^2 + 2*a*b + b^2)/(cos(d*x + c)^4 - 2*cos(d*x + c)^2 + 1)))/d, -1/8*(4*sqrt(-b)*arctan(-1/2
*((a - b)*cos(d*x + c)^2 - a - b)*sqrt(-b)*sqrt((a*cos(d*x + c)^2 - a - b)/(cos(d*x + c)^2 - 1))*sin(d*x + c)/
(a*b*cos(d*x + c)^3 - (a*b + b^2)*cos(d*x + c))) - sqrt(-a)*log(128*a^4*cos(d*x + c)^8 - 256*(a^4 + a^3*b)*cos
(d*x + c)^6 + 160*(a^4 + 2*a^3*b + a^2*b^2)*cos(d*x + c)^4 + a^4 + 4*a^3*b + 6*a^2*b^2 + 4*a*b^3 + b^4 - 32*(a
^4 + 3*a^3*b + 3*a^2*b^2 + a*b^3)*cos(d*x + c)^2 - 8*(16*a^3*cos(d*x + c)^7 - 24*(a^3 + a^2*b)*cos(d*x + c)^5
+ 10*(a^3 + 2*a^2*b + a*b^2)*cos(d*x + c)^3 - (a^3 + 3*a^2*b + 3*a*b^2 + b^3)*cos(d*x + c))*sqrt(-a)*sqrt((a*c
os(d*x + c)^2 - a - b)/(cos(d*x + c)^2 - 1))*sin(d*x + c)))/d, 1/4*(sqrt(a)*arctan(1/4*(8*a^2*cos(d*x + c)^4 -
 8*(a^2 + a*b)*cos(d*x + c)^2 + a^2 + 2*a*b + b^2)*sqrt(a)*sqrt((a*cos(d*x + c)^2 - a - b)/(cos(d*x + c)^2 - 1
))*sin(d*x + c)/(2*a^3*cos(d*x + c)^5 - 3*(a^3 + a^2*b)*cos(d*x + c)^3 + (a^3 + 2*a^2*b + a*b^2)*cos(d*x + c))
) + sqrt(b)*log(2*((a^2 - 6*a*b + b^2)*cos(d*x + c)^4 - 2*(a^2 - 2*a*b - 3*b^2)*cos(d*x + c)^2 + 4*((a - b)*co
s(d*x + c)^3 - (a + b)*cos(d*x + c))*sqrt(b)*sqrt((a*cos(d*x + c)^2 - a - b)/(cos(d*x + c)^2 - 1))*sin(d*x + c
) + a^2 + 2*a*b + b^2)/(cos(d*x + c)^4 - 2*cos(d*x + c)^2 + 1)))/d, 1/4*(sqrt(a)*arctan(1/4*(8*a^2*cos(d*x + c
)^4 - 8*(a^2 + a*b)*cos(d*x + c)^2 + a^2 + 2*a*b + b^2)*sqrt(a)*sqrt((a*cos(d*x + c)^2 - a - b)/(cos(d*x + c)^
2 - 1))*sin(d*x + c)/(2*a^3*cos(d*x + c)^5 - 3*(a^3 + a^2*b)*cos(d*x + c)^3 + (a^3 + 2*a^2*b + a*b^2)*cos(d*x
+ c))) - 2*sqrt(-b)*arctan(-1/2*((a - b)*cos(d*x + c)^2 - a - b)*sqrt(-b)*sqrt((a*cos(d*x + c)^2 - a - b)/(cos
(d*x + c)^2 - 1))*sin(d*x + c)/(a*b*cos(d*x + c)^3 - (a*b + b^2)*cos(d*x + c))))/d]

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*csc(d*x+c)^2)^(1/2),x, algorithm="giac")

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,x):;OUTPUT:Warn
ing, integration of abs or sign assumes constant sign by intervals (correct if the argument is real):Check [ab
s(sin(d*x+c))]Warning, replacing 0 by ` u`, a substitution variable should perhaps be purged.Warning, replacin
g 0 by ` u`, a substitution variable should perhaps be purged.Warning, replacing 0 by ` u`, a substitution var
iable should perhaps be purged.Warning, replacing 0 by ` u`, a substitution variable should perhaps be purged.
Warning, replacing 0 by ` u`, a substitution variable should perhaps be purged.Warning, replacing 0 by ` u`, a
 substitution variable should perhaps be purged.Warning, replacing 0 by ` u`, a substitution variable should p
erhaps be purged.Warning, replacing 0 by ` u`, a substitution variable should perhaps be purged.Warning, repla
cing 0 by ` u`, a substitution variable should perhaps be purged.Warning, need to choose a branch for the root
 of a polynomial with parameters. This might be wrong.Non regular value [0] was discarded and replaced randoml
y by 0=[97]Evaluation time: 70.94Conj Error: Bad Argument Type

________________________________________________________________________________________

maple [B]  time = 1.91, size = 419, normalized size = 5.17 \[ -\frac {\sqrt {\frac {a \left (\cos ^{2}\left (d x +c \right )\right )-a -b}{\cos ^{2}\left (d x +c \right )-1}}\, \left (-1+\cos \left (d x +c \right )\right ) \left (\ln \left (-\frac {2 \left (-1+\cos \left (d x +c \right )\right ) \left (\sqrt {b}\, \cos \left (d x +c \right ) \sqrt {-\frac {a \left (\cos ^{2}\left (d x +c \right )\right )-a -b}{\left (1+\cos \left (d x +c \right )\right )^{2}}}+\sqrt {-\frac {a \left (\cos ^{2}\left (d x +c \right )\right )-a -b}{\left (1+\cos \left (d x +c \right )\right )^{2}}}\, \sqrt {b}+a \cos \left (d x +c \right )+a +b \right )}{\sin \left (d x +c \right )^{2} \sqrt {b}}\right ) \sqrt {b}\, \sqrt {-a}-\sqrt {b}\, \ln \left (-\frac {4 \left (\sqrt {b}\, \cos \left (d x +c \right ) \sqrt {-\frac {a \left (\cos ^{2}\left (d x +c \right )\right )-a -b}{\left (1+\cos \left (d x +c \right )\right )^{2}}}+\sqrt {-\frac {a \left (\cos ^{2}\left (d x +c \right )\right )-a -b}{\left (1+\cos \left (d x +c \right )\right )^{2}}}\, \sqrt {b}-a \cos \left (d x +c \right )+a +b \right )}{-1+\cos \left (d x +c \right )}\right ) \sqrt {-a}-2 a \ln \left (4 \sqrt {-a}\, \cos \left (d x +c \right ) \sqrt {-\frac {a \left (\cos ^{2}\left (d x +c \right )\right )-a -b}{\left (1+\cos \left (d x +c \right )\right )^{2}}}+4 \sqrt {-a}\, \sqrt {-\frac {a \left (\cos ^{2}\left (d x +c \right )\right )-a -b}{\left (1+\cos \left (d x +c \right )\right )^{2}}}-4 a \cos \left (d x +c \right )\right )\right ) \sqrt {4}}{4 d \sin \left (d x +c \right ) \sqrt {-\frac {a \left (\cos ^{2}\left (d x +c \right )\right )-a -b}{\left (1+\cos \left (d x +c \right )\right )^{2}}}\, \sqrt {-a}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*csc(d*x+c)^2)^(1/2),x)

[Out]

-1/4/d*((a*cos(d*x+c)^2-a-b)/(cos(d*x+c)^2-1))^(1/2)*(-1+cos(d*x+c))*(ln(-2*(-1+cos(d*x+c))*(b^(1/2)*cos(d*x+c
)*(-(a*cos(d*x+c)^2-a-b)/(1+cos(d*x+c))^2)^(1/2)+(-(a*cos(d*x+c)^2-a-b)/(1+cos(d*x+c))^2)^(1/2)*b^(1/2)+a*cos(
d*x+c)+a+b)/sin(d*x+c)^2/b^(1/2))*b^(1/2)*(-a)^(1/2)-b^(1/2)*ln(-4*(b^(1/2)*cos(d*x+c)*(-(a*cos(d*x+c)^2-a-b)/
(1+cos(d*x+c))^2)^(1/2)+(-(a*cos(d*x+c)^2-a-b)/(1+cos(d*x+c))^2)^(1/2)*b^(1/2)-a*cos(d*x+c)+a+b)/(-1+cos(d*x+c
)))*(-a)^(1/2)-2*a*ln(4*(-a)^(1/2)*cos(d*x+c)*(-(a*cos(d*x+c)^2-a-b)/(1+cos(d*x+c))^2)^(1/2)+4*(-a)^(1/2)*(-(a
*cos(d*x+c)^2-a-b)/(1+cos(d*x+c))^2)^(1/2)-4*a*cos(d*x+c)))/sin(d*x+c)/(-(a*cos(d*x+c)^2-a-b)/(1+cos(d*x+c))^2
)^(1/2)*4^(1/2)/(-a)^(1/2)

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*csc(d*x+c)^2)^(1/2),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: sign: argument cannot be imaginary
; found %i

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \sqrt {a+\frac {b}{{\sin \left (c+d\,x\right )}^2}} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b/sin(c + d*x)^2)^(1/2),x)

[Out]

int((a + b/sin(c + d*x)^2)^(1/2), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \sqrt {a + b \csc ^{2}{\left (c + d x \right )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*csc(d*x+c)**2)**(1/2),x)

[Out]

Integral(sqrt(a + b*csc(c + d*x)**2), x)

________________________________________________________________________________________